home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMIGATAX
/
AMIGATAX.ADF
/
Tax89
< prev
next >
Wrap
Text File
|
1990-03-02
|
12KB
|
482 lines
REM tax89v1.0 feb 28/90
DATA = ontario tax return =,$1989
DATA .....jim butterfield..,c0;0
DATA ====page 1====,c0
DATA income from employmnt,#1;z2;i2
DATA pension income,i2
DATA family allowance,i2
DATA divds tax cdn corpns,#3;i2
DATA interest,i2
DATA other income,i2
DATA total income,#5;c3;s2
DATA ====step 3====,c0
DATA total income,c3;v5
DATA reg pension contr,z3;i3
DATA union/prof dues,i3
DATA carrying charges,i3
DATA other deductions,i3
DATA total deductions,#6;c4;s3
DATA net income,#7;c4;v5-v6
DATA total dedns net inc,z3;i3
DATA taxable income,#8;c4;v7-s3
DATA ====step 4====,c0
DATA personal credit,z3;c3;6066
DATA age credit,i3[3272
DATA credit for spouse,i3[5055
DATA credit for children,i3
DATA cpp contributions,i3[525
DATA uic contributions,i3[613.6
DATA total medical expnses,#13;i2
DATA ..less 3% n.i.,#14;(v13>0);v7%3[1517;c2
DATA allowable medical exp,(v13>0);v13-v14]0;c3
DATA other credits,i3
DATA line 335,#9;c4;s3[v8:REM guide confusing
DATA tax credits,#10;z4;c4;v9%17
DATA charitable donations,#11;i2
DATA credit at 17%,(v11>0);c4;v11[250%17
DATA credit at 29%,(v11>250);c4;v11-250]0%29
DATA total tax credits,#12;s4;c4
DATA =====schedule 1===,c0
DATA brckt,#15;v8;x;55605;27803;0
DATA ..on first,v15;c1
DATA ..tax is,#16;c2;y;11955;4726;0
DATA ..on remaining,#17;c1;v8-v15
DATA ..tax at percent..,#18;c1;y;29;26;17
DATA ..gives,#19;c2;v17%v18
DATA total,#20;c3;v16+v19
DATA total nr tax credit,v12;z3;c3
DATA divd tax credit,c3;v3%40/3[v20
DATA total credits,#21;c4;s3
DATA basic federal tax,#22;c4;v20-v21]0
DATA forgn tax deductions,#23;i3
DATA federal tax,#24;c4;v22-v23
DATA surtax at 4%,z3;(v22>0);c3;v22%4
DATA surtax at 1.5%,(v22>15000);c3;v22-15000]0%1.5
DATA indiv surtax payable,#28;c4;s3
DATA ===ontario tax===,0
DATA basic ontario tax,#30;c3;v22%52
DATA ontario surtax,#31;c3;v30-10000]0%10
DATA adjusted tax,#32;c4;v30+v31
DATA tax reduction,#35;c3;0-v32*2+450]0[v32
DATA ontario tax,#36;c4;v32-v35
DATA =ontario tax credits=,c0
DATA ontario tax credits,#50;i4
DATA ..do form t1c(ont)..,(v50>0);c0;0
DATA ..spouse incm needed..,(v50>0);c0;0
DATA ===step 5===,c0
DATA federal tax,c4;v24
DATA federal tax credits,#51;i3
DATA fed tax line 417,#52;c4;v24-v51
DATA indiv surtax payable,c4;v28
DATA net federal tax,#53;c4;v52+v28
DATA ontario tax payable,#54;c3;v36
DATA total payable,#55;c4;v53+v54
DATA child tax credit,z3;i3
DATA fed sales tax credit,i3
DATA ....complete sched 7...,(s3>0);c0;0
DATA ..spouse incm needed..,(s3>0);c0;0
DATA ontario tax credits,c3;v50
DATA tax deducted pr slips,i3
DATA other credits,i3
DATA total credits,#58;c4;s3
DATA x,#59;v55-v58;(v58>v55);v58-v55
DATA x,$;----------
DATA * no balance *,#60;1;(v59<1);c0;0
DATA x,#61;v60;(v58>v55);2*v60
DATA * refund due *,(v61=2);c2;v59
DATA * balance payable *,(v61=1);c2;v59
DATA end,end,end
REM: **** r u g - report utility generator ****
REM: command lines... ( c$(.) )
REM: a series of commands, each of which is separated
REM: by a semicolon;
REM: line starting with # identifies variable line.
REM: line starting with $ is special titling line.
REM: commands...
REM: may be an expression (see below), or:
REM: c# - print in column (#=0 to 4, 0=no print)
REM: z# - clear column total (#=1 to 4)
REM: t# - print column total (#=1 to 4)
REM: (z or t may have multiples, e.g., z1234)
REM: j# - jump to specified line
REM: expressions...
REM: (parentheses for test) .. continue line if true (<>0)
REM: following may be mixed using operators (below)
REM: numeric values;
REM: i# for keyboard input (# is column);
REM: s# for column total (# is column);
REM: v# for variable value;
REM: n gets yes/no value
REM: operators (left-to-right evaluation):
REM: + addition - subtraction
REM: * multiply / divide
REM: % percentage (multiply)
REM: [ smaller of ] greater of
REM: (example: 22[7 returns 7)
REM: > < = comparisons: yield 0 (not true) or 1 (true)
REM: comparisons may be used multiply, e.g., v5<=100
REM: examples...
REM: i3+100[500
REM: input value, add 100, if over 500 set to 500
REM: print result in column3
REM: c3;v12%10[100
REM: take 10% of value 12 (line 12) minimum 100
REM: and print in column 3
REM: 500;(v15>1000);v15/2
REM: value 500; or if value 15 is greater than 1000
REM: set value v15/2. do not print (no 'c' set).
CLS
PRINT " ."
Ll=0
FOR j=5 TO 6
FOR k=11 TO 12
Ll=Ll+POINT(k,j)
NEXT k
NEXT j
IF Ll=4 THEN Ll=80 ELSE Ll=60
PRINT "Please wait..."
PRINT
PRINT "When prompted, you may enter:"
PRINT " [RETURN] (for 'zero' input);"
PRINT " numeric value <return>;"
'PRINT " numeric value + "
'PRINT " (to have items totalled);
PRINT " [F1][RETURN] (to review or change data)."
PRINT
PRINT "Ontario 1989 income tax"
PRINT
PRINT "This program does not give tax advice"
PRINT " ..just helps with the arithmetic."
PRINT
PRINT "This is *not* the computer tax format"
PRINT "accepted for filing by Revenue Canada."
PRINT
PRINT "Some tax calculations call for spouse's income"
PRINT " .. not detailed in this program."
PRINT
DIM i$(200),i%(200),v&(200),c$(200),c%(4),t&(4)
c%(1)=1:c%(2)=2:c%(3)=4:c%(4)=8
READ i$
j=0
WHILE i$<>"end"
j=j+1
READ c$
L0=1
IF LEFT$(c$,1)="#" THEN
L0=INSTR(c$,";")
t=VAL(MID$(c$,2,L0-1))
IF i%(t)<>0 GOTO LinErr1
i%(t)=j:L0=L0+1
END IF
i$(j)=i$:c$(j)=MID$(c$,L0)
READ i$
WEND
PRINT
OPEN "scrn:" FOR OUTPUT AS #4
c1=1
'Next Item
NxLine:
WHILE c$(c1)<>""
c0=-1:t3=0:c=c1:c1=c1+1
IF c$(c)="c0" THEN c9=c
L0=1:L1=LEN(c$(c))
InptFlg=0
IF ASC(c$(c))=36 THEN
' $ at start of line
GOSUB BuckLine
ELSE
WHILE L0<=L1
L2=INSTR(MID$(c$(c),L0),";")
IF L2=0 THEN L2=L1+1 ELSE L2=L2+L0-1
ComdLen=L2-L0
t=ASC(MID$(c$(c),L0)):IF t>96 THEN t=t-32
IF t=67 OR (PrtFlg AND t=73) THEN ' c or i/print
REM: c - set column value
c0=VAL(MID$(c$(c),L0+1,ComdLen-1)):e=(c0>4):IF e GOTO LinErr1
c0=c%(c0)
ELSEIF t=40 THEN ' REM (
REM: (..) evaluate and continue/quit
e=ASC(MID$(c$(c),L2-1))<>41:IF e GOTO LinErr1
e=(L2-L0)<3:IF e GOTO LinErr1
L8=L0+1:L9=L2-1:GOSUB Eval
IF v#=0 THEN L2=L1 'exit
ELSEIF t=74 THEN ' REM j
REM: j - jump to line
v=VAL(MID$(c$(c),L0+1,ComdLen-1))
c1=i%(v)
L2=L1 'exit
ELSEIF PrtFlg THEN
' pass 2 .. don't calculate
ELSEIF t=88 THEN ' REM x
REM x - table lookup
y=0:v0#=v&(c)/100#:v#=v0#+1#
L0=L2+1
WHILE v#>v0# AND L0<=L1
y=y+1
L2=INSTR(MID$(c$(c),L0),";")
IF L2=0 THEN L2=L1+1 ELSE L2=L2+L0-1
ComdLen=L2-L0
v#=VAL(MID$(c$(c),L0,ComdLen))
L0=L2+1
WEND
v&(c)=INT(v#*100#+.5#)
L2=L1 'exit
ELSEIF t=89 THEN ' REM y
REM y - table usage
y1=0
L0=L2+1
WHILE y1<y AND L2<L1
y1=y1+1
L2=INSTR(MID$(c$(c),L0),";")
IF L2=0 THEN L2=L1+1 ELSE L2=L2+L0-1
ComdLen=L2-L0
v#=VAL(MID$(c$(c),L0,ComdLen))
L0=L2+1
WEND
v&(c)=INT(v#*100#+.5#)
L2=L1 'exit
ELSEIF t=84 OR t=90 THEN
' T/Z multiple column functions
c8=c0:c0=0
FOR j=L0+1 TO L2-1
t0=VAL(MID$(c$(c),j,1))
c0=c0 OR c%(t0)
NEXT j
IF t=90 THEN
FOR j=1 TO 4
IF (c0 AND c%(j))<>0 THEN t&(j)=0
NEXT j
c0=c8
ELSE
t3=1
END IF
ELSE
GOSUB SeekVal
IF t0 AND NOT InptFlg THEN
L8=L0:L9=L2:GOSUB Eval
IF ASC(RIGHT$(" "+v$,1))=129 GOTO Revise
END IF
IF t0=0 GOTO LinErr0
v&(c)=INT(v#*100+.5)
END IF
L0=L2+1
WEND
GOSUB Echo
END IF
WEND
REM: end of control strings
IF PrtFlg=0 THEN
IF c9=0 GOTO AskPrint
INPUT "want to revise this";x$
x$=UCASE$(x$)
IF x$="Y" OR x$="YES" GOTO Revise
AskPrint:
CLOSE 4:INPUT "want a printout";x$
x$=UCASE$(x$)
IF x$="Y" OR x$="YES" THEN
c1=1:OPEN "prt:" FOR OUTPUT AS #4:Ll=80:InptFlg=0:PrtFlg=-1
GOTO NxLine
END IF
END IF
PRINT ">>> end <<<"
END
' revision time
Revise:
IF c9>0 THEN
PRINT:r=0
FOR j=1 TO c9
IF c$(j)="c0" THEN r=r+1:PRINT r;">>> ";i$(j)
NEXT j
r1=1
IF r>1 THEN
PRINT "go back to which one (1 to";r;")";
INPUT r1
END IF
IF r1>0 AND r1<=r THEN
r=0
FOR j=1 TO c9
IF c$(j)="c0" THEN r=r+1:IF r=r1 THEN c=j
NEXT j
END IF
END IF
c1=c:GOTO NxLine
LinErr0:
PRINT "error item";c;"' ";MID$(c$(c),L0);" '":STOP
LinErr1:
PRINT "error item";c;"' ";MID$(c$(c),L1);" '":STOP
LinErr2:
PRINT "error item";c;"' ";MID$(c$(c),L8,L5-L8);" '":STOP
REM evaluate
Eval:
v#=0:OpNow=10
REM get a command
WHILE L8<L9
PtOp2=L8:t0=0
GOSUB SeekOp
OpNext=t0
L5=PtOp1
e=L5<=L8:IF e GOTO LinErr2
t=ASC(MID$(c$(c),L8))
IF t>96 THEN t=t-32
GOSUB SeekVal
e=t0=0:IF e GOTO LinErr2
IF (t>47 AND t<58) OR t=46 THEN
' Numeric
v0#=VAL(MID$(c$(c),L8,L5-L8))
ELSEIF t=83 OR t=86 THEN
' S or V
v1=VAL(MID$(c$(c),L8+1,L5-L8-1))
IF t=83 THEN v0#=t&(v1)/100#
IF t=86 THEN
e=i%(v1)=0
IF e THEN PRINT "** no param";v1:GOTO LinErr2
v0#=v&(i%(v1))/100#
END IF
ELSEIF t=78 THEN
' Y or N
e=InptFlg:IF e GOTO LinErr2
REM: y for yes/no
WINDOW 2,"[Y] or [N]",(10,10)-(400,30),24
WINDOW OUTPUT 2
InptFlg=-1
PRINT i$(c);"(y/n) ";
INPUT y$:y$=UCASE$(y$)
WINDOW CLOSE 2
v0#=0:IF y$="Y" THEN v0#=1
ELSE
'Inpt
e=InptFlg:IF e GOTO LinErr2
InptFlg=-1
c0=VAL(MID$(c$(c),L8+1,L5-L8-1))
e=(c0<1 OR c0>4)
IF e GOTO LinErr2
c0=c%(c0)
IF v&(c)=0 THEN
WINDOW 2,i$(c),(10,10)-(400,30),24
ELSE
GOSUB DolCents:v$=LEFT$(v$,1)+d$
IF c$<>"00" THEN v$=v$+".":v$=v$+c$
WINDOW 2,"[RETURN]="+v$,(10,10)-(400,30),24
END IF
WINDOW OUTPUT 2
PRINT i$(c);"? ";
LINE INPUT v$
IF v$<>"" THEN
v0#=VAL(v$)
ELSE
v0#=v&(c)/100#
END IF
WINDOW CLOSE 2
IF ASC(RIGHT$(" "+v$,1))=129 THEN RETURN
END IF
' perform dyadic operation
ON OpNow GOSUB lt,eq,le,gr,ne,ge,br,pct,ml,ad,sb,div,flr,cei
OpNow=OpNext:L8=PtOp2
WEND
RETURN
ad: v#=v#+v0#
RETURN
sb: v#=v#-v0#
RETURN
ml: v#=v#*v0#
RETURN
div: v#=v#/v0#
RETURN
pct: v#=v#*v0#/100#
RETURN
flr: IF v#>v0# THEN v#=v0#
RETURN
cei: IF v#<v0# THEN v#=v0#
RETURN
lt: v#=-(v#<v0#)
RETURN
eq: v#=-(v#=v0#)
RETURN
le: v#=-(v#<=v0#)
RETURN
gr: v#=-(v#>v0#)
RETURN
ne: v#=-(v#<>0#)
RETURN
ge: v#=-(v#>=0#)
RETURN
br: v#=1
RETURN
Echo:
IF c0>=0 THEN
PRINT#4,LEFT$(i$(c)+SPACE$(21),21);" ";
IF c0>=1 THEN
FOR j=1 TO 4
IF (c0 AND c%(j))=0 THEN
IF Ll>60 OR j<>1 THEN PRINT#4,SPACE$(12);
ELSE
IF t3=0 THEN
t&(j)=t&(j)+v&(c)
ELSE
v&(c)=t&(j):t&(j)=0
END IF
GOSUB DolCents
cr$=" ":IF LEFT$(v$,1)="-" THEN cr$="cr"
d$=RIGHT$(SPACE$(6)+d$,6):cm$=MID$(d$,3,1)
IF cm$<>" " THEN cm$=","
PRINT#4,LEFT$(d$,3);cm$;MID$(d$,4);".";c$;cr$;
END IF
NEXT j
END IF
PRINT#4,
END IF
RETURN
DolCents:
v$=STR$(v&(c)):IF LEN(v$)<3 THEN v$=LEFT$(v$,1)+"0"+RIGHT$(v$,1)
c$=RIGHT$(v$,2):d$=MID$(v$,2,LEN(v$)-3)
IF LEN(d$)>6 THEN d$="******"
RETURN
REM: dollars line
BuckLine:
PRINT#4,LEFT$(i$(c)+SPACE$(21),21);" ";
L0=2
WHILE L0<=L1
L2=INSTR(MID$(c$(c),L0),";")
IF L2=0 THEN L2=L1+1 ELSE L2=L2+L0-1
ComdLen=L2-L0
IF L2>0 THEN PRINT#4,RIGHT$(SPACE$(10)+MID$(c$(c),L0,ComdLen),10);" ";
IF L2=0 THEN PRINT#4,SPACE$(12);
L0=L2+1
WEND
PRINT#4,
RETURN
' value types
SeekVal:
t0=INSTR("0123456789.IVSN",CHR$(t))
RETURN
' operators and comparison groups
SeekOp:
PtOp1=0
t0=0
t2=0
WHILE PtOp2<L9 AND ((t0=0 AND PtOp1=0) OR (t0<>0 AND PtOp1<>0))
PtOp2=PtOp2+1
t1=t0
t0=INSTR("<==>===%*+-/[]",MID$(c$(c),PtOp2,1))
t2=t2 OR t0
IF t0<>0 AND PtOp1=0 THEN PtOp1=PtOp2
WEND
IF t1=t2 THEN
t0=t1
ELSE
IF t2<8 THEN t0=t2
END IF
IF PtOp1=0 THEN PtOp1=L9
RETURN
END